package Arkkomeet

import org.apache.commons.lang.builder.EqualsBuilder
import org.apache.commons.lang.builder.HashCodeBuilder

class AsuntoTratado implements Serializable {

	Integer asunTratId
	Integer minId
	String asunTratAsunto
	String asunTratDescripcion
	Minuta minuta

	int hashCode() {
		def builder = new HashCodeBuilder()
		builder.append asunTratId
		builder.append minId
		builder.toHashCode()
	}

	boolean equals(other) {
		if (other == null) return false
		def builder = new EqualsBuilder()
		builder.append asunTratId, other.asunTratId
		builder.append minId, other.minId
		builder.isEquals()
	}

	static hasMany = [acuerdoTomados: AcuerdoTomado]
	static belongsTo = [Minuta]

	static mapping = {
		id composite: ["asunTratId", "minId"]
		version false
	}

	static constraints = {
		asunTratAsunto maxSize: 65535
		asunTratDescripcion maxSize: 65535
	}
}
